home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / util / time / smallclock.lha / SmallClock / include / misc / macros.i < prev   
Text File  |  1993-07-16  |  2KB  |  91 lines

  1. ;------------------------------------------------------------------------------
  2. ; MACROS
  3. ; $VER: macros.i v1.0 (Feb-10-1994)
  4. ;------------------------------------------------------------------------------
  5.  
  6. ; "CALL EXEC LIBRARY FUNCTION"
  7. ; Result = CALLEXEC(LibraryOffset)
  8.  
  9. CALLEXEC:    MACRO
  10.         move.l    4.w,a6
  11.         jsr    _LVO\1(a6)
  12.         ENDM
  13.  
  14. EXEC:        MACRO
  15.         move.l    4.w,a6
  16.         jsr    _LVO\1(a6)
  17.         ENDM
  18.  
  19. ;------------------------------------------------------------------------------
  20.  
  21. ; "CALL A LIBRARY FUNCTION"
  22. ; Result = CALL(LibraryOffset,LibraryBase)
  23.  
  24. CALL:        MACRO
  25.         move.l    \2,a6                ; LibraryBase
  26.         jsr    _LVO\1(a6)            ; LibraryOffset
  27.         ENDM
  28.  
  29. ;------------------------------------------------------------------------------
  30.  
  31. ; "OPEN A LIBRARY"
  32. ; LibraryBase = OPENLIB(LibraryNamePointer,LibraryVersion,LibraryBase)
  33.  
  34. OPENLIB:    MACRO
  35.         lea    \1,a1                ; LibraryNamePointer
  36.         move.l    #\2,d0                ; LibraryVersion
  37.         CALLEXEC OpenLibrary
  38.         move.l    d0,\3                ; LibraryBase
  39.         ENDM
  40.  
  41. ;------------------------------------------------------------------------------
  42.  
  43. ; "CLOSE A LIBRARY"
  44. ; CLOSELIB(LibraryBase)
  45.  
  46. CLOSELIB:    MACRO                    ; CLOSELIBRARY
  47.         move.l    \1,a1                ; LibraryBase
  48.         CALLEXEC CloseLibrary
  49.         ENDM
  50.  
  51. ;------------------------------------------------------------------------------
  52.  
  53. ; "WAIT FOR RASTERLINE"
  54. ; WRAST(Line)
  55.  
  56. WRAST:        MACRO                    ; WAITRASTER
  57.         cmp.b    #\1,$DFF006            ; RasterLine
  58.         bne.s    *-8
  59.         ENDM
  60.  
  61. ;------------------------------------------------------------------------------
  62.  
  63. ; "SET TAG TO VALUE"
  64. ; SETTAG(TagList,Tag,Value)
  65.  
  66. SETTAG:        MACRO
  67.         move.l    \1,a0
  68.         move.l    #\2,d0
  69. .1:        cmp.l    ti_Tag(a0),d0
  70.         beq.s    .2
  71.         lea    ti_SIZEOF(a0),a0
  72.         bra.s    .1
  73. .2:        move.l    \3,ti_Data(a0)
  74.         ENDM
  75.  
  76. ;------------------------------------------------------------------------------
  77.  
  78. ; "RETURN TAG VALUE"
  79. ; RETTAG(TagList,Tag)
  80.  
  81. RETTAG:        MACRO
  82.         move.l    \1,a0
  83.         move.l    #\2,d0
  84. .1:        cmp.l    ti_Tag(a0),d0
  85.         beq.s    .2
  86.         lea    ti_SIZEOF(a0),a0
  87.         bra.s    .1
  88. .2:        move.l    ti_Data(a0),d0
  89.         ENDM
  90.  
  91.